package com.googlecode.smartbinding.framework.core;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 
 * Binding resource. <br/>
 * Use this to inject values into validators from views.<br/>
 * Both the validator's fields and view's fields must be annotated. <br/>
 * Ex 1:
 * 
 * <pre>
 * public class MyView extends Composite {
 * 
 * 	&#064;BindingResource
 * 	private ControlDecoration controlDecoration;
 * 
 * }
 * 
 * public class MyValidator implements IValidator {
 * 
 * 	&#064;BindingResource
 * 	private ControlDecoration controlDecoration;
 * 
 * }
 * 
 * 
 * 
 * </pre>
 * 
 * <br/>
 * Please note that the fields has the same name
 * <p/>
 * Ex:
 * 
 * <pre>
 * public class MyView extends Composite {
 * 
 * 	&#064;BindingResource(&quot;controlDecoration&quot;)
 * 	// this will inject this field into the validator
 * 	private ControlDecoration myControlDecoration;
 * 
 * }
 * 
 * public class MyValidator implements IValidator {
 * 
 * 	&#064;BindingResource
 * 	private ControlDecoration controlDecoration;
 * 
 * }
 * </pre>
 * 
 * <br/>
 * Please note that the @BindingResource of the view field has the value of the
 * validator's field
 * <p/>
 * Ex:
 * 
 * @author Iulian Dumitru
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface InjectResource {

	To[] value();

}
